load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native")
load("//tools/build_defs/oss:rn_defs.bzl", "rn_android_library", "rn_android_prebuilt_aar", "rn_prebuilt_jar")

rn_android_prebuilt_aar(
    name = "fresco-react-native",
    aar = ":fresco-binary-aar",
    visibility = ["//ReactAndroid/..."],
)

fb_native.remote_file(
    name = "fresco-binary-aar",
    sha1 = "d473020b37b7cdd3171154942b55021a55a9d990",
    url = "mvn:com.facebook.fresco:fresco:aar:2.0.0",
)

rn_android_prebuilt_aar(
    name = "fresco-drawee",
    aar = ":drawee-binary-aar",
    visibility = ["//ReactAndroid/..."],
)

fb_native.remote_file(
    name = "drawee-binary-aar",
    sha1 = "a85bfaeb87a9c8d1521c70edf6ded91ff9999475",
    url = "mvn:com.facebook.fresco:drawee:aar:2.0.0",
)

rn_android_library(
    name = "imagepipeline",
    visibility = ["//ReactAndroid/..."],
    exported_deps = [
        ":bolts",
        ":imagepipeline-base",
        ":imagepipeline-core",
        ":native-filters",
    ],
)

rn_android_prebuilt_aar(
    name = "imagepipeline-base",
    aar = ":imagepipeline-base-aar",
    visibility = ["//ReactAndroid/..."],
)

fb_native.remote_file(
    name = "imagepipeline-base-aar",
    sha1 = "d27635390665d433f987177c548d25d0473eadbe",
    url = "mvn:com.facebook.fresco:imagepipeline-base:aar:2.0.0",
)

rn_android_prebuilt_aar(
    name = "imagepipeline-core",
    aar = ":imagepipeline-aar",
    visibility = ["//ReactAndroid/..."],
)

fb_native.remote_file(
    name = "imagepipeline-aar",
    sha1 = "7bc59327fb4895c465cbfeede700daf349ea56da",
    url = "mvn:com.facebook.fresco:imagepipeline:aar:2.0.0",
)

rn_android_prebuilt_aar(
    name = "native-filters",
    aar = ":nativeimagefilters-aar",
    visibility = ["//ReactAndroid/..."],
)

remote_file(
    name = "nativeimagefilters-aar",
    sha1 = "f49525db580abc4d2fb0a74fac771fc6c69f2adb",
    url = "mvn:com.facebook.fresco:nativeimagefilters:aar:2.0.0",
)

rn_prebuilt_jar(
    name = "bolts",
    binary_jar = ":download-bolts.jar",
    visibility = ["//ReactAndroid/..."],
)

fb_native.remote_file(
    name = "download-bolts.jar",
    sha1 = "d85884acf6810a3bbbecb587f239005cbc846dc4",
    url = "mvn:com.parse.bolts:bolts-tasks:jar:1.4.0",
)

rn_android_prebuilt_aar(
    name = "fbcore",
    aar = ":fbcore-aar",
    visibility = ["//ReactAndroid/..."],
)

fb_native.remote_file(
    name = "fbcore-aar",
    sha1 = "8de91f71e8aa84a4d9be4dd88d1a0ac51600ad60",
    url = "mvn:com.facebook.fresco:fbcore:aar:2.0.0",
)

rn_android_prebuilt_aar(
    name = "imagepipeline-okhttp3",
    aar = ":imagepipeline-okhttp3-binary-aar",
    visibility = ["//ReactAndroid/..."],
)

fb_native.remote_file(
    name = "imagepipeline-okhttp3-binary-aar",
    sha1 = "bc1212ca66cd09678b416894ea8bd04102d26c5f",
    url = "mvn:com.facebook.fresco:imagepipeline-okhttp3:aar:2.0.0",
)
